package com.example.attempt.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Data
public class HomeworkWithFile {
    private String tid;
    private String cid;     // 表示返回时间类型
    private String time;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")      // 表示接收时间类型
    private LocalDateTime htime;
    private String content;
    private String title;
    private MultipartFile hFile;
    private float studentRate;
    private float teacherRate;
    private float assistanceRate;
    private float threshold;
    private int isDistribute=0;

    public int getTime(){
        DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        this.htime = LocalDateTime.parse(this.time,df);
        return 0;
    }
}
